# Maintainer: Alexey Pavlov <alexpux@gmail.com>

_realname=docbook-xsl
pkgbase=mingw-w64-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}")
pkgver=1.79.1
pkgrel=1
pkgdesc='XML stylesheets for Docbook-xml transformations (mingw-w64)'
arch=('any')
license=('custom')
url='http://docbook.sourceforge.net/'
depends=("${MINGW_PACKAGE_PREFIX}-libxml2"
         "${MINGW_PACKAGE_PREFIX}-libxslt"
         "${MINGW_PACKAGE_PREFIX}-docbook-xml")
install=${_realname}-${CARCH}.install
source=("https://downloads.sourceforge.net/docbook/${_realname}-${pkgver}.tar.bz2")
sha256sums=('725f452e12b296956e8bfb876ccece71eeecdd14b94f667f3ed9091761a4a968')

package() {
  cd ${srcdir}/${_realname}-${pkgver}

  _pkgroot=${pkgdir}${MINGW_PREFIX}/share/xml/docbook/xsl-stylesheets-${pkgver}

    install -dm755 ${_pkgroot}
  install -m644 VERSION VERSION.xsl ${_pkgroot}

  for fn in assembly common eclipse epub epub3 fo highlighting html htmlhelp javahelp lib \
                  manpages params profiling roundtrip template website xhtml xhtml-1_1 xhtml5; do
    install -dm755 ${_pkgroot}/${fn}
    install -m644 ${fn}/*.{xml,xsl,dtd,ent} ${_pkgroot}/${fn} || true  # ignore missing files
  done

  install -Dm644 catalog.xml ${_pkgroot}/catalog.xml
  install -dm755 ${pkgdir}${MINGW_PREFIX}/etc/xml
  install -Dm644 COPYING ${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/LICENSE
}
